package com.tbmob.tb_h5;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

public class PlayletFragmentActivity extends FragmentActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题栏
        //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 隐藏状态栏

        String codeId = getIntent().getStringExtra("codeId");

        setContentView(R.layout.activity_playlet);

        ImageView title_iv = findViewById(R.id.a_title_iv);
        title_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        //显示短视频
        /*com.tb.mob.config.TbPlayletConfig config = new com.tb.mob.config.TbPlayletConfig.Builder()
                .codeId(codeId)//平台申请的代码位id
                .build();
        com.tb.mob.TbPlayletManager.load(this, config, new com.tb.mob.TbPlayletManager.IReplaceListener() {
            @Override
            public void onFail(String s) {

            }

            @Override
            public void getContentPage(com.kwad.sdk.api.KsTubePage ksTubePage, android.support.v4.app.Fragment fragment) {
                getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment).commitAllowingStateLoss();
            }

            @Override
            public void onVideoPlayStart(com.kwad.sdk.api.KsContentPage.ContentItem contentItem) {

            }

            @Override
            public void onVideoPlayPaused(com.kwad.sdk.api.KsContentPage.ContentItem contentItem) {

            }

            @Override
            public void onVideoPlayResume(com.kwad.sdk.api.KsContentPage.ContentItem contentItem) {

            }

            @Override
            public void onVideoPlayCompleted(com.kwad.sdk.api.KsContentPage.ContentItem contentItem) {

            }

            @Override
            public void onPageLeave(com.kwad.sdk.api.KsContentPage.ContentItem contentItem) {

            }
        });*/
    }
}
